<template>
  <page-body>
    <view class="page">
      <view class="flex benben-position-layout flex flex-wrap align-center report_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub report_fd0_0'>
          <view class='flex flex-wrap align-center report_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
            data-url="1">
            <text class='fu-iconfont2  report_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <text class='report_fd0_0_c1_c0'>举报</text>
          </view>
          <view class='flex flex-wrap align-center justify-end report_fd0_0_c0'>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---意见反馈表单flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout">
        <view class='flex flex-direction align-stretch report_fd1_0'>
          <view class='flex flex-wrap align-center report_fd1_0_c0'>
            <text class='report_fd1_0_c0_c0'>请选择举报原因</text>
          </view>
          <view class='flex flex-direction flex-wrap align-stretch justify-between report_fd1_0_c1'>
            <benben-select-diy ref="showSelectPopup1714985620627" class-name='flex flex-direction align-stretch flex'
              :items.sync="changeType" v-model="changeId" default-type="aid" default-label="name" :allow-cancel='false'
              type="radio" :disabled='false'>
              <template v-for='(item,key0) in changeType'>
                <view v-if="item.isSelected" class='flex justify-between flex-sub flex report_fd1_0_c1_c0_c1' :key=""
                  @tap="$refs.showSelectPopup1714985620627.tapHandle(key0)">
                  <text>{{item.title}}</text>
                  <image class='report_fd1_0_c1_c0_c0_c1' mode="aspectFit" :src='STATIC_URL+"37.png"'></image>
                </view>
                <view v-else class='flex justify-between flex-sub flex report_fd1_0_c1_c0_c1' :key=""
                  @tap="$refs.showSelectPopup1714985620627.tapHandle(key0)">
                  <text>{{item.title}}</text>
                  <image class='report_fd1_0_c1_c0_c0_c1' mode="aspectFit" :src='STATIC_URL+"84.png"'></image>
                </view>
              </template>
            </benben-select-diy>
          </view>
          <view class='flex flex-wrap align-center report_fd1_0_c2'>
            <text class='report_fd1_0_c2_c0'>请填写举报理由</text>
          </view>
          <view class='flex flex-direction flex-wrap align-stretch report_fd1_0_c3'>
            <view class='flex flex-wrap report_fd1_0_c3_c0'>
              <textarea class='flex report_input_fd1_0_c3_c0' confirm-type="done" :placeholder="'问题描述的越详细，有助于我们更快的解决问题'"
                :maxlength="300" :show-num='true' placeholder-style="color:#999;font-size:28rpx"
                v-model="fd1_0_c3_c0" />
              <template>
                <view class='flex flex justify-end report_numberfd1_0_c3_c0_c0'>
                  <text>{{fd1_0_c3_c0.length}}</text>
                  <text>/</text>
                  <text>300</text>
                </view>
              </template>
            </view>
          </view>
        </view>
        <button class='flex-sub report_fd1_1' @tap="submitFunc()">提交</button>
      </view>

      <!---意见反馈表单flex布局结束-->


    </view>
  </page-body>
</template>
<script>
  import {
    validate
  } from '@/common/utils/validate.js'

  export default {
    components: {},


    data() {
      return {
        "fd1_0_c3_c0": "",
        "changeType": [],
        "changeId": "",
        "changeName": "",
        "img": [],
        "img_id": "",
        "body": "",
        "type": "1",
        "id": "283"
      };
    },
    computed: {

    },
    watch: {},
    onLoad(options) {
      let {
        type,
        id
      } = options
      if (type !== undefined) this.type = type
      if (id !== undefined) this.id = id
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {
      this.getDataListFunc()
    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      //获取举报类型
      async getDataListFunc() {
        //请求方法
        //数据验证

        let datachangeType = await this.$api.post(global.apiUrls.post6414719bdc956, {
          user_type: '2'
        });

        if (datachangeType.data.code != 1) {
          this.$message.info(datachangeType.data.msg);
          return
        }
        let infochangeType = datachangeType.data;
        this.changeType = infochangeType.data

      },
      //提交
      async submitFunc() {
        if (!validate(this.changeId, 'require')) {
          this.$message.info('请选择举报类型');
          return false;
        }
        //请求方法
        //数据验证

        let data6444e1a11c124 = await this.$api.dbPost(global.apiUrls.post6414724b96f3f, {
          post_id: this.id,
          type_id: this.changeId,
          body: this.fd1_0_c3_c0,
        });

        if (data6444e1a11c124.data.code != 1) {
          this.$message.info(data6444e1a11c124.data.msg);
          return
        }
        let info6444e1a11c124 = data6444e1a11c124.data;


        this.$message.info('提交成功');
        setTimeout(() => {
          this.$urouter.navigateBack(1);
        }, 500)
      }
    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: #F8F8F8;
    background-size: 100% auto;
  }

  .report_flex_0 {
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .report_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 700;
    color: #333333;
    line-height: 50rpx;
  }

  .report_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }

  .report_fd0_0_c0 {
    width: 120rpx;
  }

  .report_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .report_fd1_1 {
    background: var(--benbenbgColor2);
    border-radius: 44rpx 44rpx 44rpx 44rpx;
    font-size: 32rpx;
    color: var(--benbenFontColor3);
    height: 88rpx;
    line-height: 88rpx;
    width: 638rpx;
    position: fixed;
    left: 53rpx;
    bottom: calc(40rpx + var(--window-bottom));
  }

  .report_numberfd1_0_c3_c0_c0 {
    width: 100%;
    font-size: 24rpx;
    color: rgba(153, 153, 153, 1);
    line-height: 46rpx;
    font-weight: 400;
  }

  .report_input_fd1_0_c3_c0 {
    width: 100%;
    height: 166rpx;
    font-size: 28rpx;
    font-weight: 400;
    color: var(--benbenFontColor0);
  }

  .report_fd1_0_c3_c0 {
    background: rgba(248, 248, 248, 1);
    width: 686rpx;
    border-radius: 10rpx 10rpx 10rpx 10rpx;
    margin: 0rpx 0rpx 0rpx 32rpx;
    padding: 24rpx;
    background-size: 100% auto;
  }

  .report_fd1_0_c3 {
    margin: 0rpx 0rpx 0rpx 0rpx;
  }

  .report_fd1_0_c2_c0 {
    font-size: 32rpx;
    font-weight: 600;
    color: var(--benbenFontColor0);
    line-height: 45rpx;
  }

  .report_fd1_0_c2 {
    padding: 32rpx 0rpx 32rpx 32rpx;
  }

  .report_fd1_0_c1_c0_c1_c1 {
    width: 32rpx;
    height: 32rpx;
  }

  .report_fd1_0_c1_c0_c1 {
    border-bottom: 1px solid #eee;
    margin: 24rpx 0rpx 24rpx 0rpx;
    padding-bottom: 24rpx;
  }

  .report_fd1_0_c1_c0_c0_c1 {
    width: 32rpx;
    height: 32rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .report_fd1_0_c1_c0_c0 {
    border-bottom: 1px solid #eee;
    padding: 24rpx 0rpx 24rpx 0rpx;
  }

  .report_fd1_0_c1 {
    padding: 0rpx 29rpx 16rpx 29rpx;
  }

  .report_fd1_0_c0_c0 {
    font-size: 32rpx;
    font-weight: 600;
    color: var(--benbenFontColor0);
    margin: 0rpx 32rpx 0rpx 32rpx;
  }

  .report_fd1_0_c0 {
    padding: 32rpx 0rpx 12rpx 0rpx;
  }

  .report_fd1_0 {
    background: var(--benbenbgColor1);
    background-size: 100% auto !important;
    padding: 0rpx 0rpx 48rpx 0rpx;
    margin: 0rpx 0rpx 20rpx 0rpx;
  }
</style>
